To solve the sensor node localization problem of Wireless Sensor and Actor Network (WSAN), a range-based localization algorithm with virtual force in WSAN was proposed in this paper, in which mobile actor nodes were used instead of Wireless Sensor Network (WSN) anchors for localization algorithm, and Time Of Arrival (TOA) was combined with virtual force. In this algorithm, the actor nodes were driven under the action of virtual force and made themself move close to the sensor node which sent location request, and node localization was completed by the calculation of the distance between nodes according to the signal transmission time. The simulation results show that the localization success rate of the proposed algorithm can be improved by 20% and the average localization time and cost are less than the traditional TOA algorithm. It can apply to real-time field with small number of actor nodes.